//
//  SecondViewController.m
//  07-Delegate
//
//  Created by 李昊林 on 16/7/22.
//  Copyright © 2016年 李昊林. All rights reserved.
//

#import "SecondViewController.h"
#import "FirstViewController.h"
#import "ViewController.h"

@interface SecondViewController ()
@property (nonatomic, strong) UITextField *textFiled;
@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UITextField *textFiled = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 100, 60)];
    textFiled.backgroundColor = [UIColor greenColor];
    [self.view addSubview:textFiled];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.backgroundColor = [UIColor yellowColor];
    button.frame = CGRectMake(100, 180, 100, 60);
    [self.view addSubview:button];
    [button addTarget:self action:@selector(comeBack:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)comeBack:(UIButton *)button{
    NSInteger count = self.navigationController.viewControllers.count;
   // FirstViewController *first = self.navigationController.viewControllers.count;
    [self.navigationController popViewControllerAnimated:YES];
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end